#!/bin/bash

hostname_id=`hostname | awk -F- '{print $NF}'`
myid=`expr $hostname_id + 1`
make_myid(){
   echo $myid > /data1/myid
}

case "$1" in
  zkServer)
    make_myid
    #ls -la /etc/zookeeper
    #cat /etc/zookeeper/zoo.cfg
    echo "start zk server"
    /opt/zookeeper/bin/zkServer.sh start-foreground
  ;;
  bash)
    /bin/bash
  ;;
esac

#exec /usr/bin/tini -s -- "${CMD}"
